Add a gtk-keynav-use-caret mode setting
authorMatthias Clasen <mclasen@redhat.com>
Sat, 5 Mar 2016 03:25:37 +0000 (22:25 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 5 Mar 2016 03:43:24 +0000 (22:43 -0500)
For accessibility reasons, it is useful to have a global setting
that makes carets visible in all text.

https://bugzilla.gnome.org/show_bug.cgi?id=602526
https://bugzilla.gnome.org/show_bug.cgi?id=762799

gtk/gtksettings.c

index 0b158a69318b0315430a4caf8898ecf80ddee9f6..3be0fffd3995fc81e2a5eb7a1c1ef5fb07dd129d 100644 (file)
@@ -220,7 +220,8 @@ enum {
   PROP_DIALOGS_USE_HEADER,
   PROP_ENABLE_PRIMARY_PASTE,
   PROP_RECENT_FILES_ENABLED,
-  PROP_LONG_PRESS_TIME
+  PROP_LONG_PRESS_TIME,
+  PROP_KEYNAV_USE_CARET
 };
 
 /* --- prototypes --- */
@@ -1723,6 +1724,24 @@ gtk_settings_class_init (GtkSettingsClass *class)
                                                                GTK_PARAM_READWRITE),
                                              NULL);
   g_assert (result == PROP_LONG_PRESS_TIME);
+
+  /**
+   * GtkSettings:gtk-keynav-use-caret:
+   *
+   * Whether GTK+ should make sure that text can be navigated with
+   * a caret, even if it is not editable. This is useful when using
+   * a screen reader.
+   *
+   * Since: 3.20
+   */
+  result = settings_install_property_parser (class,
+                                             g_param_spec_boolean ("gtk-keynav-use-caret",
+                                                                   P_("Whether to show cursor in text"),
+                                                                   P_("Whether to show cursor in text"),
+                                                                   FALSE,
+                                                                   GTK_PARAM_READWRITE),
+                                             NULL);
+  g_assert (result == PROP_KEYNAV_USE_CARET);
 }
 
 static void